const store = require('./store')
const {
  changeCounterAction,
  changeNameAction,
} = require('./store/actionCreator')

const unsubscribe = store.subscribe(() => {
  console.log('订阅数据的变化：', store.getState())
})

// 修改store中的数据
store.dispatch(changeNameAction('kobe'))

// 修改counter
store.dispatch(changeCounterAction(10))

// 取消订阅
unsubscribe()

store.dispatch(changeCounterAction(20))
